export default {
  data () {
    return {
      pageStart: 'page_start',
      pageEnd: 'page_end',
    }
  },
  methods: {
    // 页面进入
    pageStartAction () {
      const { page, startTime } = this.pageTrackerInfo
      // 发送当前页面信息给安卓
      this.$hybrid.action('currentPageInfo', { 
        page,
        startTime: startTime && startTime.toString()
       })
      // 自有埋点
      this.$buryPoint.action({
        eventName: this.pageStart,
        ...this.pageTrackerInfo
      });
    },
    // 页面退出
    pageEndAction () {
      this.$buryPoint.action({
        eventName: this.pageEnd,
        endTime: new Date().getTime(),
        ...this.pageTrackerInfo
      })
    }
  }
}